package VectorApproach;

public class VEle {

	public TrajVector trv1 = null, trv2 = null;
	protected double dist = 0;
	public VEle(TrajVector trv1, TrajVector trv2) {
		this.trv1 = trv1;
		this.trv2 = trv2;
	}
	
	public void ACT001_countDist(double thresholdAngleMax, double thresholdDistMax) {
		/*
		double[] sim = new VSimilarity().EquallConnectAndProject(this.trv1, this.trv2);
		if(sim[0] <= angleMax && sim[1] <= distMax && sim[2] <= distMax) {
			this.dist = sim[1];
		}
		else {
			this.dist = -1;
		}
		*/
		double[] sim = new VSimilarity().ProjectDist(this.trv1, this.trv2);
		if(sim[0] <= thresholdAngleMax && sim[1] <= thresholdDistMax && sim[1] != -1) {
			this.dist = sim[0] / thresholdAngleMax + sim[1] / thresholdDistMax;
		}
		else {
			this.dist = -1;
		}
		if(this.dist > 1) {
			this.dist = -1;
		}
	}
	
	public double GET001_dist() {
		return this.dist;
	}
}
